/*****************************************************************************
 *
 *                      HUSONG PROPRIETARY INFORMATION
 *
 *          The information contained herein is proprietary to HUSONG
 *           and shall not be reproduced or disclosed in whole or in part
 *                    or used for any design or manufacture
 *              without direct written authorization from HUSONG.
 *
 *            Copyright (c) 2015 by HUSONG.  All rights reserved.
 *
 *****************************************************************************/
package com.broker.consumer.controller;

import me.send.broker.entity.Version;
import me.send.broker.entity.base.ReturnJsonBean;
import me.send.broker.enums.AuthodType;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.broker.consumer.controller.base.BaseController;

/**
 * @author maxmin
 *
 * @date 2015年9月16日 下午1:45:57
 */
@Controller
@RequestMapping(value="/version")
public class VersionController extends BaseController {
	
	/**
	 * 检查是否有版本更新
	 * @return
	 * @author maxmin
	 * @date 2015年9月16日下午1:47:52
	 */
	@RequestMapping(value="/check")
	@ResponseBody
	public ReturnJsonBean check(String devicenumber){
		ReturnJsonBean rt = new ReturnJsonBean();
		try {
			rt.setCode(ReturnJsonBean.SUCCESS);
			rt.setMessage(ReturnJsonBean.SUCCESS_STR);
			Version version = versionService.check();
			rt.setDatas(version);
		} catch (Exception e) {
			e.printStackTrace();
			saveException(AuthodType.tangjianglong.getName(), "VersionController", "check()", e);
		}
		return rt;
	}
}
